package com.qfmy.app.controller.common;

import com.qfmy.app.service.common.AdvertisementService;
import com.qfmy.common.result.Result;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 清风明月
 * @Package com.qfmy.app.controller.common
 * @date 2025/4/14
 * @description 广告控制类
 */
@RestController
@RequestMapping("/app/advertisement")
@SuppressWarnings("all")
public class AdvertisementController {

    /**
     * 注入service
     */
    @Resource
    private AdvertisementService advertisementService;

    /**
     * 根据类型和位置获取广告
     */
    @RequestMapping("/getAdvertisement")
    public Result getAdvertisement(@RequestParam Integer type, @RequestParam Integer position) {
        List<String> advertisement = advertisementService.getAdvertisement(type, position);
        return Result.ok(advertisement);
    }

}
